import React from 'react'
import {Route, IndexRoute} from 'react-router'

import {
    App,
    Home,  //主页
    Agreement,//协议
    OrderList, //我的订单
    AuthError, //授权失败页
    ConfirmOrder,//订单确认页
    Success,//提交成功页
    NotFoundPage,
    OrderDetail,//订单详情
    ProcessDetail,
    AddAddress,
    AddressEdit,
    AddressList
} from './containers'

export default (
    <Route path="/" component={App}>
        <IndexRoute component={Home}/>
        <Route path="home" components={Home}/>
        <Route path="orderList(/:type)" components={OrderList}/>
        <Route path="agreement" components={Agreement}/>
        <Route path="authError" components={AuthError}/>
        <Route path="success/:name/:orderId/:chargeOrderId" components={Success}/>
        <Route path="confirmOrder" components={ConfirmOrder}/>
        <Route path="orderDetail/:orderId/:chargeOrderId" components={OrderDetail}/>
        <Route path="processDetail" components={ProcessDetail}/>
        <Route path="addAddress" components={AddAddress}/>
        <Route path="addressEdit/:addressId" components={AddressEdit}/>
        <Route path="addressList" components={AddressList}/>
        <Route path="orderList(/:type)" components={OrderList}/>
        <Route path="*" component={NotFoundPage}/>
    </Route>
);